<%@ page language="java" import="java.util.*,java.sql.*,java.util.Date,com.gc.rss.*,com.sun.syndication.feed.synd.SyndEntry,com.sun.syndication.feed.synd.SyndContent;" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <body>
    RSS. <br>

    <%  
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance(); 
    String a="http://blog.sina.com.cn/rss/yilinzazhi.xml";
    AAA C=new AAA();
     List<SyndEntry> syndEntries =C.readRss(a);
     %>
     

     <%
    for (SyndEntry syndEntry : syndEntries) {
	String entryTitle = syndEntry.getTitle();
	String entryLink = syndEntry.getLink();
	SyndContent entryDescription = syndEntry.getDescription();
	String content = entryDescription.getValue();

	%> 
标题： <a href="<%=entryLink %>"><%=entryTitle %></a>  <BR/>连接:<%=entryLink %><BR/>
	<% }%>
 <%    
  
String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=gc;user=sa;password=sa;";   
Connection conn = DriverManager.getConnection(connectionUrl);   
  
 Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);   
 String sql= "insert into rss(rss_title,rss_original,rss_type,rss_url)values(entryTitle,?,?,entryLink)";
  stmt.close();    
  conn.close();      
  %>  
  </body>
</html>
